﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3. org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DotNetWikiBot Framework</title>
<meta name="description" content="DotNetWikiBot Framework description and introduction." />
<meta name="keywords" content="DotNetWikiBot,Framework,wiki,MediaWiki,client,API,software,bot,robot,.NET,2.0,Mono,console,library,dll,C#,script,scripting,program,programming,develop,development,management,compile,download,learn,XML,XHTML,advanced,parsing,regular,expression,tutorial,web,Linux,Windows,free,freeware,open,source,code,.cs,Solaris,Mac,BSD,easy-to-learn,easy-to-use,educational,beginner,easy,easily,support,report,bug,feature,forum,tracker,good,learning,ready-to-use,clean,plain,classic,platform-independent,zip,stable,mature,release,run,file,package,Visual,Basic,Managed,C++,JScript,J#" />
<meta name="author" content="Iaroslav Vassiliev" />
<meta name="revised" content="2009-01-29" />
<style type="text/css">
<!--
body {
	font-family: Arial, Helvetica, Sans-serif;       
}

h1 {
	font-weight: normal;
	color: #000080;
	margin-top: 0px;	
	margin-bottom: 5px;
}

h2 {
	font-size:1 20%;
	font-weight: normal;
	margin-bottom: 10px;
}

p, ul, ol {
	line-height: 170%;
	padding-left: 5%;
	padding-right: 5%;	
}

pre.code {
	font-family: monospace;
	margin-left: 5%;
	margin-right: 5%;
	padding: 3%;
	background-color: #F8F8F8;
	border-style: solid;
	border-width: 1px;	
}

span.code_comment {
	color: #00AA00;
}

span.code_keyword {
	color: #0000FF;
}

span.code_string {
	color: #8B4513;
}

a.nav {
	text-decoration: none;
	color: #FFFFFF;
	font-weight: bold;
}

a:hover.nav {
	text-decoration: underline;
}
-->
</style>
</head>

<body>
<h1>DotNetWikiBot Framework</h1>
<table class="nav" style="width:100%; font-size:80%; line-height:100%; color:#FFFFFF; background-color:#000080">
<tr><td>
&nbsp;
<a class="nav" href="http://dotnetwikibot.sourceforge.net">Home</a> |
<a class="nav" href="http://sourceforge.net/project/showfiles.php?group_id=167838">Download</a> |
<a class="nav" href="http://sourceforge.net/tracker/?func=add&amp;group_id=167838&amp;atid=844535">Request a new feature</a> |
<a class="nav" href="http://sourceforge.net/tracker/?func=add&amp;group_id=167838&amp;atid=844532">Report a bug</a> |
<a class="nav" href="http://sourceforge.net/forum/forum.php?forum_id=572545">Ask for support</a>
</td></tr>
</table>

<h2>Purpose</h2>
<p>
DotNetWikiBot Framework is intended to help with many complicated and routine tasks of wiki site development and maintenance. DotNetWikiBot Framework is a clean full-featured client API, that allows you to build programs and Web robots easily to manage information on MediaWiki-powered sites. DotNetWikiBot Framework is also good for learning C# and .NET 2.0.
</p>

<h2>Some facts about DotNetWikiBot Framework</h2>
<ul>
<li>DotNetWikiBot Framework is an easy-to-learn and easy-to-use library (API) for programming applications and web robots, that could help in construction and maintenance of wiki sites.</li>
<li>DotNetWikiBot is compiled as a .NET dynamic link library (.dll file), that could be used directly or in other products, based on DotNetWikiBot Framework.</li>
<li>DotNetWikiBot is written in <a href="http://msdn2.microsoft.com/en-us/library/z1zx9t92(VS.80).aspx">C#</a>, based on <a href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5">Microsoft® .NET Framework 2.0</a> and primarily targets the sites running free <a href="http://www.mediawiki.org">MediaWiki</a> software.</li>
<li>Using <a href="http://www.mono-project.com/">Mono</a> framework, DotNetWikiBot can work under Linux, Unix, BSD, Solaris and Mac OS X as well as under Windows.</li>
<li>Any .NET language can be used to access DotNetWikiBot library functions, including Visual Basic, Managed C++, JScript,J# and F#. Only minimal programming skills are required to make bots with DotNetWikiBot Framework, it allows to build bots in fast and simple manner.</li>
<li>DotNetWikiBot source code is located in a single .cs file, that could be easily changed and recompiled to suite your needs. It requires only C# compiler, no other tools.</li>
<li>DotNetWikiBot Framework is good for educational purposes. It's source code is written in a plain classic manner, allowing to learn object-oriented programming, .NET features, web robot making, regular expressions and advanced XML parsing in a short time.</li>
<li>DotNetWikiBot doesn't require installation. It is downloaded in a single small .zip file along with compiled documentation, source code, ready-to-use sample bot script and sample GUI utility "BatchFileUploader.exe", that allows batch upload of files to wiki sites.</li>
<li>DotNetWikiBot is free.</li>
</ul>

<h2>Requirements</h2>
<p style="margin:0 0 0 0; padding:0 0 0 0">
Only a few things are required to run DotNetWikiBot Framework on .NET Framework 2.0:
</p>
<ul>
<li>Microsoft .NET Framework 2.0-compatible machine.<br /><span style="font-size:70%">(minimum: 600 MHz processor, 128 Mb RAM, 280 Mb free disk space for 32-bit machines or 610 Mb for 64-bit machines)</span></li>
<li>Microsoft .NET Framework 2.0-compatible operating system.<br /><span style="font-size:70%">(any Microsoft desktop OS suits, except Windows 95, NT Server, NT Workstation and Windows Server 2003 Enterprise/Datacenter Edition for Itanium-based systems)</span></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5">Microsoft .NET Framework 2.0</a> itself.<br /><span style="font-size:70%">(.NET Framework 2.0 redistributable package already has C# compiler (csc.exe) onboard and no other is required, although you can use .NET SDK or Visual Studio)<br />(note: you can't compile and run framework files with Microsoft .NET Framework 1.0 or 1.1, version 2.0 is required)</span></li>
<li>Text editor to edit source code.</li>
<li>Web browser to control bot activities on-line.</li>
</ul>
<p style="margin:0 0 0 0; padding:0 0 0 0">
These things are required to run DotNetWikiBot Framework on Mono:
</p>
<ul>
<li>Mono-compatible machine.<br /><span style="font-size:70%">(on <a href="http://www.mono-project.com/Supported_Platforms">this page</a> you can find the detailed list of supported architectures)</span></li>
<li>Mono-compatible operating system.<br /><span style="font-size:70%">(Linux, Unix, OpenBSD, FreeBSD, NetBSD, Solaris, Mac OS X, Windows)</span></li>
<li><a href="http://www.mono-project.com/Downloads">Mono</a> framework itself.</li>
<li>Text editor to edit source code.</li>
<li>Web browser to control bot activities on-line.</li>
</ul>

<h2>Files</h2>
<p style="margin:0 0 0 0; padding:0 0 0 0">
DotNetWikiBot Framework package includes several files:
</p>
<ul title="DotNetWikiBot Framework package includes several files:">
<li>Readme.html - this introduction file.</li>
<li>DotNetWikiBot.dll - the compiled framework itself.</li>
<li>DotNetWikiBot.cs - source code of the framework.</li>
<li>BotScript.cs - C# source code file ready for your bot code. Contains some useful examples.</li>
<li>DotNetWikiBot.i18n.xml - internationalization file, that contains bot's interface messages, translated to local languages. You can also translate messages in that file to your local language. And you can add your own messages to that file too, if it is necessry.</li>
<li>BotInfo.netmodule - assembly description module, that is necessary in some IDEs, when you reference DotNetWikiBot.dll in your project.</li>
<li>BatchFileUploader.cs - C# source code file of "BatchFileUploader.exe" GUI utility.</li>
<li>BatchFileUploader.exe - sample GUI utility, that allows batch upload of files to wiki sites.</li>
<li>Documentation.chm - documentation file, automatically generated from code XML comments. In this documentation you will find the description of DotNetWikiBot Framework classes, types, properties and methods. A few examples are also available.</li>
<li>Compile &amp; Run.bat - fast-build batch. Run it to launch your bot. It will compile and run BotScript.exe file. Additional compilation instructions can be found inside this file.</li>
</ul>

<h2>Usage</h2>
<ol>
<li>Extract DotNetWikiBot Framework files from .zip package.</li>
<li>Open BotScript.cs file in any text editor. Look at the example code there.</li>
<li>Input some experimental code.</li>
<li>Make sure .NET Framework 2.0 libraries and C# compiler is available. Correct path to C# compiler ("csc.exe" file) in "Compile &amp; Run.bat" file if necessary</li>
<li>Run "Compile &amp; Run.bat" file.</li>
<li>Debug your code.</li>
<li>Explore the documentation ("Documentation.chm" file) and the framework source code to deeper understand the framework structure.</li>
</ol>

<h2>Short tutorial</h2>
<p>
There are only 3 types of objects in DotNetWikiBot Framework: Site, Page and PageList. They are used as follows.
</p>
<pre class="code">
<span class="keyword">using</span> DotNetWikiBot;	<span class="code_comment">// Reference DotNetWikiBot namespace for easy access</span>

<span class="keyword">class</span> MyBot : Bot	<span class="code_comment">// Derive your bot class from framework's Bot class</span>
{
    <span class="keyword">public static void</span> Main()
    {
        <span class="code_comment">// Firstly make Site object, specifying site's URL and your bot account</span>
        Site enWiki = <span class="code_keyword">new</span> Site(<span class="code_string">"http://en.wikipedia.org"</span>, <span class="code_string">"myBotLogin"</span>, <span class="code_string">"myPassword"</span>);
        <span class="code_comment">// Then make Page object, specifying site and page title in constructor</span>
        Page p = <span class="code_keyword">new</span> Page(enWiki, <span class="code_string">"Art"</span>);
        <span class="code_comment">// Load actual page text from live wiki</span>
        p.Load();
        <span class="code_comment">// Add "Visual arts" category link to "Art" page's text</span>
        p.AddToCategory(<span class="code_string">"Visual arts"</span>);
        <span class="code_comment">// Save "Art" article's text back to live wiki with specified comment</span>
        p.Save(<span class="code_string">"comment: category link added"</span>, <span class="code_keyword">true</span>);

        <span class="code_comment">// Make empty PageList object, representing collection of pages</span>
        PageList pl = <span class="code_keyword">new</span> PageList(enWiki);
        <span class="code_comment">// Fill it with 100 pages, where "nuclear disintegration" is mentioned</span>
        pl.FillFromGoogleSearchResults(<span class="code_string">"nuclear disintegration"</span>, 100);
        <span class="code_comment">// Load texts and metadata of all found pages from live wiki</span>
        pl.LoadEx();
        <span class="code_comment">// Now suppose, that we must correct some typical mistake in all our pages</span>
        <span class="code_keyword">foreach</span> (Page i <span class="code_keyword">in</span> pl)
            <span class="code_comment">// In each page we will replace one phrase with another</span>
            i.text = i.text.Replace(<span class="code_string">"fusion products"</span>, <span class="code_string">"fission products"</span>);
        <span class="code_comment">// Finally we'll save all changed pages to wiki with 5 seconds interval</span>			
        pl.SaveSmoothly(5, <span class="code_string">"comment: mistake autocorrection"</span>, <span class="code_keyword">true</span>);
		
        <span class="code_comment">// Now clear our PageList so we could re-use it</span>
        pl.Clear();
        <span class="code_comment">// Fill it with all articles in "Astronomy" category and it's subcategories</span>
        pl.FillFromCategoryTree(<span class="code_string">"Astronomy"</span>);
        <span class="code_comment">// Download and save all PageList's articles to specified local XML file</span>
        pl.SaveXMLDumpToFile(<span class="code_string">"Dumps\\ArticlesAboutAstronomy.xml"</span>);		
    }
}
</pre>
<p>
More examples are available in BotScript.cs file of DotNetWikiBot package. Refer to documentation for functions details.
</p>

<h2>License</h2>
<p>
DotNetWikiBot Framework is available under The MIT License (also called X11 license). Below is the text of the license.
</p>

<div style="margin-left:10%; margin-right:10%; background-color:#DDDDDD; border-style:solid; border-width:2px">
<p>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
</p>

<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
</p>

<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
</div>

<p>
Please, mention DotNetWikiBot, if you use it in your software.
</p>

<p>
<a href="http://sourceforge.net/projects/dotnetwikibot" style="float:right; padding-left:10px; margin-bottom:20px"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=167838&type=13" width="120" height="30" border="0" alt="Get DotNetWikiBot Framework at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>

<a href="http://validator.w3.org/check?uri=referer" style="float:right; padding-left:10px; padding-bottom:20px"><img src="http://www.w3.org/Icons/valid-xhtml11" style="border:none" alt="Valid XHTML 1.1" height="31" width="88" /></a>
</p>

</body>
</html>